{extend name="public/base"/}
{block name="body"}
<div class="main-box no-header clearfix">
    <header class="main-box-header clearfix">
        <div class="pull-left">
            <h2>{$meta_title}</h2>
        </div>
        <div class="pull-right">
            <a href="{:url('add')}" class="btn btn-primary pull-right"> <i class="fa fa-plus-circle fa-lg"></i> 新增用户</a>
        </div>
    </header>
    <div class="main-box-body clearfix">
        <div class="navbar navbar-default">
            <form action="" class="navbar-form form-inline" method="get">
                <div class="form-group">
                    <label class="control-label" for="input-order-id">用户名</label>
                    <div class="input-group">
                        <input type="text" name="username" value="{$param['username']|default=''}" placeholder="用户名"
                               class="form-control">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label" for="input-order-id">昵称</label>
                    <div class="input-group">
                        <input type="text" name="nickname" value="{$param['nickname']|default=''}" placeholder="昵称"
                               class="form-control">
                    </div>
                </div>
                <button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 筛选</button>
            </form>
        </div>
        <div class="table-responsive">
            <table class="table user-list table-hover">
                <thead>
                <tr>
                    <th>
                        <span>用户</span>
                    </th>
                    <th>
                        <span>Email</span>
                    </th>
                    <th>
                        <span>手机号码</span>
                    </th>
                    <th>
                        <span>授权分组</span>
                    </th>
                    <th>
                        <span>创建时间</span>
                    </th>
                    <th class="text-center">
                        <span>状态</span>
                    </th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="item"}
                <tr>
                    <td>
                        {if isset($item['avatar_url']) && $item['avatar_url']}
                        <img src="{$item['avatar_url']}" alt="{$item['nickname']}"/>
                        {else/}
                        <img src="{:avatar($item['uid'])}" alt="{$item['nickname']}"/>
                        {/if}
                        <a href="#" class="user-link">{$item['nickname']}</a>
                        <span class="user-subhead">{$item['username']}</span>
                    </td>
                    <td>
                        <span>{$item['email']}</span>
                    </td>
                    <td>
                        <span>{$item['mobile']}</span>
                    </td>
                    <td>{$item['group_list']|implode=',',###}</td>
                    <td>{$item['reg_time']|date='Y-m-d',###}</td>
                    <td class="text-center">
                        {if condition="$item['status']"}
                        <span class="label label-primary">启用</span>
                        {else/}
                        <span class="label label-danger">禁用</span>
                        {/if}
                    </td>
                    <td>

                        <a href="{:url('edit',array('id'=>$item['uid']))}" class="table-link" title="">
                            编辑
                        </a>
                        {if $item['uid'] neq $uid}
                        <a href="{:url('auth',array('id'=>$item['uid']))}" class="table-link">
                            授权
                        </a>
                        <a href="{:url('del',array('id'=>$item['uid']))}" class="table-link confirm ajax-get">
                            删除
                        </a>
                        {/if}
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
            {$page}
        </div>
    </div>
</div>
{/block}